Fix coverage commenting#77
Merged
Merged
Conversation
Splits the commenting from the CI by: 1. Performing the testing and uploading the coverage files in ci.yaml workflow 2. Downloading coverage and commenting, never checking out the code. This should allow for contributors (not part of the organization) to make PRs while still facilitating the coverage commenting without requiring the change of trigger from "pull_request" to "pull_request_target", which may introduce security vulunerabilities targetting the tests.
- Pass run-id/github-token so download-artifact reaches the CI run - Pipe PR number through pr-number.txt (workflow_run.pull_requests is empty for fork PRs) - Pass issue-number explicitly to the comment action - Gate coverage job on pull_request event + successful CI conclusion - Restore COVERAGE_PYTHON env var; cap artifact retention at 1 day
Collaborator
|
tweaked a few things - did you try this on a fork? |
Contributor
Author
Haven't tried it yet - I don't think it would get triggered here anyways until this is merged in anyways because of: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Splits the commenting from the CI by:
ci.yamlworkflowcoverage.yaml) workflow.This should allow for non-organization contributors to make PRs while still facilitating the coverage commenting without requiring the change of trigger from "pull_request" to "pull_request_target", which may introduce security vulnerabilities targeting the tests.
@nx10, mind taking a quick look at this one. The only part I am not certain about is the downloading of the artifact and if it ends up grabbing the correct PR number (i.e. artifact name) in the the subsequent workflow. Primarily needed some way of ensuring each artifact was unique to the PR.